#include "ModelerWindow.h"
#include <QTextEdit>
#include <QDockWidget>
#include <QListWidget>

#include "WorldWidget.h"
#include "Map.h"
#include "ShapeManagerWidget.h"

ModelerWindow::ModelerWindow(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags)
{
	ui.setupUi(this);

    setCentralWidget(new QTextEdit);

	 WorldWidget *world = new WorldWidget(this);
	 

     QDockWidget *dock = new QDockWidget("Shapes", this);
     dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	 /*
     QListWidget *customerList = new QListWidget(dock);
     customerList->addItems(QStringList()
             << "Cube"
             << "Sphere"
             << "Torus");
     dock->setWidget(customerList);
	 */
	 dock->setWidget(world->GetShapeManagerWidget());
	 dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
     addDockWidget(Qt::RightDockWidgetArea, dock);
//     viewMenu->addAction(dock->toggleViewAction());

     dock = new QDockWidget("Textures", this);
	 /*
     QListWidget *paragraphsList = new QListWidget(dock);
     paragraphsList->addItems(QStringList()
             << "Grass"
             << "Sky"
             << "Wall");
     dock->setWidget(paragraphsList);
	 */
	 dock->setWidget(world->GetTextureManagerWidget());
	 dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
     addDockWidget(Qt::RightDockWidgetArea, dock);
     //viewMenu->addAction(dock->toggleViewAction());

     dock = new QDockWidget("Preview", this);
     dock->setWidget(new RaycasterWidget(this));
	 dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
     addDockWidget(Qt::RightDockWidgetArea, dock);


}

ModelerWindow::~ModelerWindow()
{

}


